#include <Cmaid.h>
#include <stdlib.h>
#include <stdio.h>

const char *names[] = {
	"Julian",
	"Klaus",
	"Felix",
	"Vincent",
	"Alex",
	"Steffen",
	"Adrian",
	"Mark",
	"Kevin",
	"Peter",
	"Christian",
	"Lothar",
	NULL
};

int
main()
{
	Cmaid_Set *skip_list;
	int i;

	skip_list = cmaid_skip_list_set_new(4, NULL);
	for (i = 0; names[i]; i++)
		cmaid_set_add(skip_list, names[i]);
	
	for (i = 0; names[i]; i++)
		if (!cmaid_set_get(skip_list, names[i]))
			printf("Meeep, %s not found\n", names[i]);
		else
			printf("%s\n", (char *)cmaid_set_get(skip_list, names[i]));

	if (cmaid_set_get(skip_list, "blabla"))
		printf("Meep, found blabla");
	
	cmaid_set_remove(skip_list, names[0]);
	cmaid_set_remove(skip_list, names[4]);
	for (i = 0; names[i]; i++)
		if (!cmaid_set_get(skip_list, names[i]))
			printf("%s was removed\n", names[i]);
		else
			printf("%s\n", (char *)cmaid_set_get(skip_list, names[i]));


	cmaid_container_destroy(skip_list);

	return 0;
}
